using Carter;
using DDD.Api.Modules;
using DDD.Extensions;

var builder = WebApplication.CreateBuilder(args);
builder.Host
    .AddSerilog(builder.Configuration)
    .ReplaceIConfiguration();

builder.Services.AddApplication<StartupModule>();

var app = builder.Build();

app.UseDefaultSwaggerUI();
app.UseExceptionHandler();
app.UseSerilogRequestLog();
app.UseHttpsRedirection();
app.UseAuthorization();
app.MapCarter();
app.MapControllers();

await app.RunAsync();
